CREATE TABLE [dbo].[COTIZACIONES_DETALLES]
(
[ID] [numeric] (10, 0) NOT NULL,
[ID_PRODUCTO] [numeric] (10, 0) NOT NULL,
[COSTO] [numeric] (10, 2) NOT NULL,
[PRECIO] [numeric] (10, 2) NOT NULL,
[CANTIDAD] [numeric] (10, 2) NOT NULL,
[DESCUENTO] [numeric] (10, 2) NULL,
[X_DESCUENTO] [numeric] (10, 4) NULL,
[IMPUESTO] [numeric] (10, 2) NULL,
[X_IMPUESTO] [numeric] (10, 4) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[COTIZACIONES_DETALLES] ADD CONSTRAINT [PK_COTIZACIONES_DETALLES] PRIMARY KEY CLUSTERED  ([ID], [ID_PRODUCTO]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[COTIZACIONES_DETALLES] ADD CONSTRAINT [FK_COTIZACIONES_DETALLES_COTIZACIONES] FOREIGN KEY ([ID]) REFERENCES [dbo].[COTIZACIONES] ([ID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[COTIZACIONES_DETALLES] ADD CONSTRAINT [FK_COTIZACIONES_DETALLES_PRODUCTOS] FOREIGN KEY ([ID_PRODUCTO]) REFERENCES [dbo].[PRODUCTOS] ([ID])
GO
